<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
Author: George Karachalias &lt;george.karachalias@cs.kuleuven.be&gt;
        Sebastian Graf &lt;sgraf1337@gmail.com&gt;
-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE TupleSections #-}</span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE ApplicativeDo #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-comment">-- | Types used through-out pattern match checking. This module is mostly there</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- to be imported from &quot;GHC.Tc.Types&quot;. The exposed API is that of</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- &quot;GHC.HsToCore.PmCheck.Oracle&quot; and &quot;GHC.HsToCore.PmCheck&quot;.</span><span>
</span><span id="line-15"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.PmCheck.Types</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Representations for Literals and AltCons</span></span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier">PmLit</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitValue"><span class="hs-identifier">PmLitValue</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier">PmAltCon</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmLitType"><span class="hs-identifier">pmLitType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConType"><span class="hs-identifier">pmAltConType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Equality on 'PmAltCon's</span></span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier">PmEquality</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqPmAltCon"><span class="hs-identifier">eqPmAltCon</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Operations on 'PmLit'</span></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier">literalToPmLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#negatePmLit"><span class="hs-identifier">negatePmLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#overloadPmLit"><span class="hs-identifier">overloadPmLit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmLitAsStringLit"><span class="hs-identifier">pmLitAsStringLit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier">coreExprAsPmLit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Caching partially matched COMPLETE sets</span></span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#ConLikeSet"><span class="hs-identifier">ConLikeSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PossibleMatches"><span class="hs-identifier">PossibleMatches</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><span class="hs-comment">-- * PmAltConSet</span></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier">PmAltConSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#emptyPmAltConSet"><span class="hs-identifier">emptyPmAltConSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#isEmptyPmAltConSet"><span class="hs-identifier">isEmptyPmAltConSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#elemPmAltConSet"><span class="hs-identifier">elemPmAltConSet</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#extendPmAltConSet"><span class="hs-identifier">extendPmAltConSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConSetElems"><span class="hs-identifier">pmAltConSetElems</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><span class="hs-comment">-- * A 'DIdEnv' where entries may be shared</span></span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Shared"><span class="hs-identifier">Shared</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier">SharedDIdEnv</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#emptySDIE"><span class="hs-identifier">emptySDIE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#lookupSDIE"><span class="hs-identifier">lookupSDIE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#sameRepresentativeSDIE"><span class="hs-identifier">sameRepresentativeSDIE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#setIndirectSDIE"><span class="hs-identifier">setIndirectSDIE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#setEntrySDIE"><span class="hs-identifier">setEntrySDIE</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#traverseSDIE"><span class="hs-identifier">traverseSDIE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><span class="hs-comment">-- * The pattern match oracle</span></span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#VarInfo"><span class="hs-identifier">VarInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmState"><span class="hs-identifier">TmState</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TyState"><span class="hs-identifier">TyState</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier">Delta</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier">Deltas</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#initDeltas"><span class="hs-identifier">initDeltas</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#liftDeltasM"><span class="hs-identifier">liftDeltasM</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier">EvVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DSet.html"><span class="hs-identifier">GHC.Types.Unique.DSet</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html"><span class="hs-identifier">GHC.Types.Unique.DFM</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.DataCon.html"><span class="hs-identifier">GHC.Core.DataCon</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html"><span class="hs-identifier">GHC.Core.ConLike</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html"><span class="hs-identifier">GHC.Data.List.SetOps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.List.SetOps.html#unionLists"><span class="hs-identifier">unionLists</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html"><span class="hs-identifier">GHC.Types.Literal</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Map.html"><span class="hs-identifier">GHC.Core.Map</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier">exprType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#evVarPred"><span class="hs-identifier">evVarPred</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Numeric.html#"><span class="hs-identifier">Numeric</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Float.html#fromRat"><span class="hs-identifier">fromRat</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#"><span class="hs-identifier">Data.Foldable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier">find</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">NonEmpty</span></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Ratio.html#"><span class="hs-identifier">Data.Ratio</span></a></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semi</span></span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="hs-comment">-- | Literals (simple and overloaded ones) for pattern match checking.</span><span>
</span><span id="line-78"></span><span class="hs-comment">--</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- See Note [Undecidable Equality for PmAltCons]</span><span>
</span><span id="line-80"></span><span class="hs-keyword">data</span><span> </span><span id="PmLit"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-var">PmLit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PmLit"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-var">PmLit</span></a></span></span><span>
</span><span id="line-81"></span><span>           </span><span class="hs-special">{</span><span> </span><span id="pm_lit_ty"><span class="annot"><span class="annottext">PmLit -&gt; Type
</span><a href="GHC.HsToCore.PmCheck.Types.html#pm_lit_ty"><span class="hs-identifier hs-var hs-var">pm_lit_ty</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-82"></span><span>           </span><span class="hs-special">,</span><span> </span><span id="pm_lit_val"><span class="annot"><span class="annottext">PmLit -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#pm_lit_val"><span class="hs-identifier hs-var hs-var">pm_lit_val</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitValue"><span class="hs-identifier hs-type">PmLitValue</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span class="hs-keyword">data</span><span> </span><span id="PmLitValue"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitValue"><span class="hs-identifier hs-var">PmLitValue</span></a></span></span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="PmLitInt"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-var">PmLitInt</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>
</span><span id="line-86"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PmLitRat"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-var">PmLitRat</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#Rational"><span class="hs-identifier hs-type">Rational</span></a></span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PmLitChar"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitChar"><span class="hs-identifier hs-var">PmLitChar</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-88"></span><span>  </span><span class="hs-comment">-- We won't actually see PmLitString in the oracle since we desugar strings to</span><span>
</span><span id="line-89"></span><span>  </span><span class="hs-comment">-- lists</span><span>
</span><span id="line-90"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PmLitString"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-var">PmLitString</span></a></span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-91"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PmLitOverInt"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-var">PmLitOverInt</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-comment">{- How often Negated? -}</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>
</span><span id="line-92"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PmLitOverRat"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-var">PmLitOverRat</span></a></span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-comment">{- How often Negated? -}</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#Rational"><span class="hs-identifier hs-type">Rational</span></a></span><span>
</span><span id="line-93"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PmLitOverString"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverString"><span class="hs-identifier hs-var">PmLitOverString</span></a></span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">-- | Undecidable semantic equality result.</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- See Note [Undecidable Equality for PmAltCons]</span><span>
</span><span id="line-97"></span><span class="hs-keyword">data</span><span> </span><span id="PmEquality"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier hs-var">PmEquality</span></a></span></span><span>
</span><span id="line-98"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Equal"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span></span><span>
</span><span id="line-99"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Disjoint"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Disjoint"><span class="hs-identifier hs-var">Disjoint</span></a></span></span><span>
</span><span id="line-100"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="PossiblyOverlap"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PossiblyOverlap"><span class="hs-identifier hs-var">PossiblyOverlap</span></a></span></span><span>
</span><span id="line-101"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680917914"><span id="local-6989586621680917916"><span class="annot"><span class="annottext">PmEquality -&gt; PmEquality -&gt; Bool
(PmEquality -&gt; PmEquality -&gt; Bool)
-&gt; (PmEquality -&gt; PmEquality -&gt; Bool) -&gt; Eq PmEquality
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: PmEquality -&gt; PmEquality -&gt; Bool
$c/= :: PmEquality -&gt; PmEquality -&gt; Bool
== :: PmEquality -&gt; PmEquality -&gt; Bool
$c== :: PmEquality -&gt; PmEquality -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680917907"><span id="local-6989586621680917909"><span id="local-6989586621680917911"><span class="annot"><span class="annottext">Int -&gt; PmEquality -&gt; ShowS
[PmEquality] -&gt; ShowS
PmEquality -&gt; String
(Int -&gt; PmEquality -&gt; ShowS)
-&gt; (PmEquality -&gt; String)
-&gt; ([PmEquality] -&gt; ShowS)
-&gt; Show PmEquality
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [PmEquality] -&gt; ShowS
$cshowList :: [PmEquality] -&gt; ShowS
show :: PmEquality -&gt; String
$cshow :: PmEquality -&gt; String
showsPrec :: Int -&gt; PmEquality -&gt; ShowS
$cshowsPrec :: Int -&gt; PmEquality -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-comment">-- | When 'PmEquality' can be decided. @True &lt;=&gt; Equal@, @False &lt;=&gt; Disjoint@.</span><span>
</span><span id="line-104"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-type">decEquality</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier hs-type">PmEquality</span></a></span><span>
</span><span id="line-105"></span><span id="decEquality"><span class="annot"><span class="annottext">decEquality :: Bool -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var hs-var">decEquality</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-106"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var">decEquality</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Disjoint"><span class="hs-identifier hs-var">Disjoint</span></a></span><span>
</span><span id="line-107"></span><span>
</span><span id="line-108"></span><span class="hs-comment">-- | Undecidable equality for values represented by 'PmLit's.</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- See Note [Undecidable Equality for PmAltCons]</span><span>
</span><span id="line-110"></span><span class="hs-comment">--</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- * @Just True@ ==&gt; Surely equal</span><span>
</span><span id="line-112"></span><span class="hs-comment">-- * @Just False@ ==&gt; Surely different (non-overlapping, even!)</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- * @Nothing@ ==&gt; Equality relation undecidable</span><span>
</span><span id="line-114"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqPmLit"><span class="hs-identifier hs-type">eqPmLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier hs-type">PmEquality</span></a></span><span>
</span><span id="line-115"></span><span id="eqPmLit"><span class="annot"><span class="annottext">eqPmLit :: PmLit -&gt; PmLit -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqPmLit"><span class="hs-identifier hs-var hs-var">eqPmLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span id="local-6989586621680917903"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917903"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621680917902"><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917902"><span class="hs-identifier hs-var">v1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span id="local-6989586621680917901"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917901"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span id="local-6989586621680917900"><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917900"><span class="hs-identifier hs-var">v2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>  </span><span class="hs-comment">-- no haddock | pprTrace &quot;eqPmLit&quot; (ppr t1 &lt;+&gt; ppr v1 $$ ppr t2 &lt;+&gt; ppr v2) False = undefined</span><span>
</span><span id="line-117"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917903"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917901"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Disjoint"><span class="hs-identifier hs-var">Disjoint</span></a></span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; PmLitValue -&gt; PmEquality
</span><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917902"><span class="hs-identifier hs-var">v1</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917900"><span class="hs-identifier hs-var">v2</span></a></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-120"></span><span>    </span><span id="local-6989586621680917897"><span class="annot"><span class="annottext">go :: PmLitValue -&gt; PmLitValue -&gt; PmEquality
</span><a href="#local-6989586621680917897"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-type">PmLitInt</span></a></span><span> </span><span id="local-6989586621680917883"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917883"><span class="hs-identifier hs-var">i1</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-type">PmLitInt</span></a></span><span> </span><span id="local-6989586621680917882"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917882"><span class="hs-identifier hs-var">i2</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var">decEquality</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917883"><span class="hs-identifier hs-var">i1</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917882"><span class="hs-identifier hs-var">i2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-type">PmLitRat</span></a></span><span> </span><span id="local-6989586621680917881"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917881"><span class="hs-identifier hs-var">r1</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-type">PmLitRat</span></a></span><span> </span><span id="local-6989586621680917880"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917880"><span class="hs-identifier hs-var">r2</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var">decEquality</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917881"><span class="hs-identifier hs-var">r1</span></a></span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Rational -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917880"><span class="hs-identifier hs-var">r2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitChar"><span class="hs-identifier hs-type">PmLitChar</span></a></span><span> </span><span id="local-6989586621680917879"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917879"><span class="hs-identifier hs-var">c1</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitChar"><span class="hs-identifier hs-type">PmLitChar</span></a></span><span> </span><span id="local-6989586621680917878"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917878"><span class="hs-identifier hs-var">c2</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var">decEquality</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917879"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917878"><span class="hs-identifier hs-var">c2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-type">PmLitString</span></a></span><span> </span><span id="local-6989586621680917877"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917877"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-type">PmLitString</span></a></span><span> </span><span id="local-6989586621680917876"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917876"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var">decEquality</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917877"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917876"><span class="hs-identifier hs-var">s2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-type">PmLitOverInt</span></a></span><span> </span><span id="local-6989586621680917875"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917875"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span id="local-6989586621680917874"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917874"><span class="hs-identifier hs-var">i1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-type">PmLitOverInt</span></a></span><span> </span><span id="local-6989586621680917873"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917873"><span class="hs-identifier hs-var">n2</span></a></span></span><span> </span><span id="local-6989586621680917872"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917872"><span class="hs-identifier hs-var">i2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917875"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917873"><span class="hs-identifier hs-var">n2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917874"><span class="hs-identifier hs-var">i1</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917872"><span class="hs-identifier hs-var">i2</span></a></span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-type">PmLitOverRat</span></a></span><span> </span><span id="local-6989586621680917870"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917870"><span class="hs-identifier hs-var">n1</span></a></span></span><span> </span><span id="local-6989586621680917869"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917869"><span class="hs-identifier hs-var">r1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-type">PmLitOverRat</span></a></span><span> </span><span id="local-6989586621680917868"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917868"><span class="hs-identifier hs-var">n2</span></a></span></span><span> </span><span id="local-6989586621680917867"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917867"><span class="hs-identifier hs-var">r2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917870"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917868"><span class="hs-identifier hs-var">n2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917869"><span class="hs-identifier hs-var">r1</span></a></span><span> </span><span class="annot"><span class="annottext">Rational -&gt; Rational -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917867"><span class="hs-identifier hs-var">r2</span></a></span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverString"><span class="hs-identifier hs-type">PmLitOverString</span></a></span><span> </span><span id="local-6989586621680917866"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917866"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverString"><span class="hs-identifier hs-type">PmLitOverString</span></a></span><span> </span><span id="local-6989586621680917865"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917865"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917866"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917865"><span class="hs-identifier hs-var">s2</span></a></span><span>                                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-130"></span><span>    </span><span class="annot"><a href="#local-6989586621680917897"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><span class="hs-identifier">_</span></span><span>                    </span><span class="annot"><span class="annottext">PmLitValue
</span><span class="hs-identifier">_</span></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#PossiblyOverlap"><span class="hs-identifier hs-var">PossiblyOverlap</span></a></span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span class="hs-comment">-- | Syntactic equality.</span><span>
</span><span id="line-133"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917862"><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-134"></span><span>  </span><span id="local-6989586621680917860"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917860"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680917859"><span class="annot"><span class="annottext">== :: PmLit -&gt; PmLit -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></span></span><span> </span><span id="local-6989586621680917858"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917858"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLit -&gt; PmLit -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqPmLit"><span class="hs-identifier hs-var">eqPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917860"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917858"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">PmEquality -&gt; PmEquality -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- | Type of a 'PmLit'</span><span>
</span><span id="line-137"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmLitType"><span class="hs-identifier hs-type">pmLitType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-138"></span><span id="pmLitType"><span class="annot"><span class="annottext">pmLitType :: PmLit -&gt; Type
</span><a href="GHC.HsToCore.PmCheck.Types.html#pmLitType"><span class="hs-identifier hs-var hs-var">pmLitType</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span id="local-6989586621680917857"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917857"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917857"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span class="hs-comment">-- | Undecidable equality for values represented by 'ConLike's.</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- See Note [Undecidable Equality for PmAltCons].</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- 'PatSynCon's aren't enforced to be generative, so two syntactically different</span><span>
</span><span id="line-143"></span><span class="hs-comment">-- 'PatSynCon's might match the exact same values. Without looking into and</span><span>
</span><span id="line-144"></span><span class="hs-comment">-- reasoning about the pattern synonym's definition, we can't decide if their</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- sets of matched values is different.</span><span>
</span><span id="line-146"></span><span class="hs-comment">--</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- * @Just True@ ==&gt; Surely equal</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- * @Just False@ ==&gt; Surely different (non-overlapping, even!)</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- * @Nothing@ ==&gt; Equality relation undecidable</span><span>
</span><span id="line-150"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqConLike"><span class="hs-identifier hs-type">eqConLike</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html#ConLike"><span class="hs-identifier hs-type">ConLike</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html#ConLike"><span class="hs-identifier hs-type">ConLike</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier hs-type">PmEquality</span></a></span><span>
</span><span id="line-151"></span><span id="eqConLike"><span class="annot"><span class="annottext">eqConLike :: ConLike -&gt; ConLike -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqConLike"><span class="hs-identifier hs-var hs-var">eqConLike</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.ConLike.html#RealDataCon"><span class="hs-identifier hs-type">RealDataCon</span></a></span><span> </span><span id="local-6989586621680917854"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917854"><span class="hs-identifier hs-var">dc1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.ConLike.html#RealDataCon"><span class="hs-identifier hs-type">RealDataCon</span></a></span><span> </span><span id="local-6989586621680917853"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917853"><span class="hs-identifier hs-var">dc2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#decEquality"><span class="hs-identifier hs-var">decEquality</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917854"><span class="hs-identifier hs-var">dc1</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917853"><span class="hs-identifier hs-var">dc2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqConLike"><span class="hs-identifier hs-var">eqConLike</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-type">PatSynCon</span></a></span><span> </span><span id="local-6989586621680917851"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680917851"><span class="hs-identifier hs-var">psc1</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.ConLike.html#PatSynCon"><span class="hs-identifier hs-type">PatSynCon</span></a></span><span> </span><span id="local-6989586621680917850"><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680917850"><span class="hs-identifier hs-var">psc2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680917851"><span class="hs-identifier hs-var">psc1</span></a></span><span> </span><span class="annot"><span class="annottext">PatSyn -&gt; PatSyn -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PatSyn
</span><a href="#local-6989586621680917850"><span class="hs-identifier hs-var">psc2</span></a></span><span>
</span><span id="line-154"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-155"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqConLike"><span class="hs-identifier hs-var">eqConLike</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="annot"><span class="annottext">ConLike
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#PossiblyOverlap"><span class="hs-identifier hs-var">PossiblyOverlap</span></a></span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span class="hs-comment">-- | Represents the head of a match against a 'ConLike' or literal.</span><span>
</span><span id="line-158"></span><span class="hs-comment">-- Really similar to 'GHC.Core.AltCon'.</span><span>
</span><span id="line-159"></span><span class="hs-keyword">data</span><span> </span><span id="PmAltCon"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-var">PmAltCon</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PmAltConLike"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-var">PmAltConLike</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html#ConLike"><span class="hs-identifier hs-type">ConLike</span></a></span><span>
</span><span id="line-160"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span id="PmAltLit"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-var">PmAltLit</span></a></span></span><span>     </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-keyword">data</span><span> </span><span id="PmAltConSet"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-var">PmAltConSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PACS"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-var">PACS</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#ConLikeSet"><span class="hs-identifier hs-type">ConLikeSet</span></a></span><span> </span><span class="hs-glyph">!</span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#emptyPmAltConSet"><span class="hs-identifier hs-type">emptyPmAltConSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span>
</span><span id="line-165"></span><span id="emptyPmAltConSet"><span class="annot"><span class="annottext">emptyPmAltConSet :: PmAltConSet
</span><a href="GHC.HsToCore.PmCheck.Types.html#emptyPmAltConSet"><span class="hs-identifier hs-var hs-var">emptyPmAltConSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLikeSet -&gt; [PmLit] -&gt; PmAltConSet
</span><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-var">PACS</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
forall a. UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#emptyUniqDSet"><span class="hs-identifier hs-var">emptyUniqDSet</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-166"></span><span>
</span><span id="line-167"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#isEmptyPmAltConSet"><span class="hs-identifier hs-type">isEmptyPmAltConSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-168"></span><span id="isEmptyPmAltConSet"><span class="annot"><span class="annottext">isEmptyPmAltConSet :: PmAltConSet -&gt; Bool
</span><a href="GHC.HsToCore.PmCheck.Types.html#isEmptyPmAltConSet"><span class="hs-identifier hs-var hs-var">isEmptyPmAltConSet</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-type">PACS</span></a></span><span> </span><span id="local-6989586621680917845"><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917845"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span id="local-6989586621680917844"><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917844"><span class="hs-identifier hs-var">lits</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLikeSet -&gt; Bool
forall a. UniqDSet a -&gt; Bool
</span><a href="GHC.Types.Unique.DSet.html#isEmptyUniqDSet"><span class="hs-identifier hs-var">isEmptyUniqDSet</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917845"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[PmLit] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917844"><span class="hs-identifier hs-var">lits</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-comment">-- | Whether there is a 'PmAltCon' in the 'PmAltConSet' that compares 'Equal' to</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- the given 'PmAltCon' according to 'eqPmAltCon'.</span><span>
</span><span id="line-172"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#elemPmAltConSet"><span class="hs-identifier hs-type">elemPmAltConSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-173"></span><span id="elemPmAltConSet"><span class="annot"><span class="annottext">elemPmAltConSet :: PmAltCon -&gt; PmAltConSet -&gt; Bool
</span><a href="GHC.HsToCore.PmCheck.Types.html#elemPmAltConSet"><span class="hs-identifier hs-var hs-var">elemPmAltConSet</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-type">PmAltConLike</span></a></span><span> </span><span id="local-6989586621680917841"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917841"><span class="hs-identifier hs-var">cl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-type">PACS</span></a></span><span> </span><span id="local-6989586621680917840"><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917840"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span class="annot"><span class="annottext">[PmLit]
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; ConLikeSet -&gt; Bool
forall a. Uniquable a =&gt; a -&gt; UniqDSet a -&gt; Bool
</span><a href="GHC.Types.Unique.DSet.html#elementOfUniqDSet"><span class="hs-identifier hs-var">elementOfUniqDSet</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917841"><span class="hs-identifier hs-var">cl</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917840"><span class="hs-identifier hs-var">cls</span></a></span><span>
</span><span id="line-174"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#elemPmAltConSet"><span class="hs-identifier hs-var">elemPmAltConSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-type">PmAltLit</span></a></span><span> </span><span id="local-6989586621680917838"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917838"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-type">PACS</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
</span><span class="hs-identifier">_</span></span><span>   </span><span id="local-6989586621680917837"><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917837"><span class="hs-identifier hs-var">lits</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLit -&gt; [PmLit] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-identifier hs-var">elem</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917838"><span class="hs-identifier hs-var">lit</span></a></span><span> </span><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917837"><span class="hs-identifier hs-var">lits</span></a></span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#extendPmAltConSet"><span class="hs-identifier hs-type">extendPmAltConSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span>
</span><span id="line-177"></span><span id="extendPmAltConSet"><span class="annot"><span class="annottext">extendPmAltConSet :: PmAltConSet -&gt; PmAltCon -&gt; PmAltConSet
</span><a href="GHC.HsToCore.PmCheck.Types.html#extendPmAltConSet"><span class="hs-identifier hs-var hs-var">extendPmAltConSet</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-type">PACS</span></a></span><span> </span><span id="local-6989586621680917835"><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917835"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span id="local-6989586621680917834"><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917834"><span class="hs-identifier hs-var">lits</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-type">PmAltConLike</span></a></span><span> </span><span id="local-6989586621680917833"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917833"><span class="hs-identifier hs-var">cl</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLikeSet -&gt; [PmLit] -&gt; PmAltConSet
</span><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-var">PACS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConLikeSet -&gt; ConLike -&gt; ConLikeSet
forall a. Uniquable a =&gt; UniqDSet a -&gt; a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#addOneToUniqDSet"><span class="hs-identifier hs-var">addOneToUniqDSet</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917835"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917833"><span class="hs-identifier hs-var">cl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917834"><span class="hs-identifier hs-var">lits</span></a></span><span>
</span><span id="line-179"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#extendPmAltConSet"><span class="hs-identifier hs-var">extendPmAltConSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-type">PACS</span></a></span><span> </span><span id="local-6989586621680917831"><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917831"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span id="local-6989586621680917830"><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917830"><span class="hs-identifier hs-var">lits</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-type">PmAltLit</span></a></span><span> </span><span id="local-6989586621680917829"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917829"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLikeSet -&gt; [PmLit] -&gt; PmAltConSet
</span><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-var">PACS</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917831"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[PmLit] -&gt; [PmLit] -&gt; [PmLit]
forall a.
(HasDebugCallStack, Outputable a, Eq a) =&gt;
[a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Data.List.SetOps.html#unionLists"><span class="hs-identifier hs-var">unionLists</span></a></span><span> </span><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917830"><span class="hs-identifier hs-var">lits</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917829"><span class="hs-identifier hs-var">lit</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConSetElems"><span class="hs-identifier hs-type">pmAltConSetElems</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-183"></span><span id="pmAltConSetElems"><span class="annot"><span class="annottext">pmAltConSetElems :: PmAltConSet -&gt; [PmAltCon]
</span><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConSetElems"><span class="hs-identifier hs-var hs-var">pmAltConSetElems</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PACS"><span class="hs-identifier hs-type">PACS</span></a></span><span> </span><span id="local-6989586621680917828"><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917828"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span id="local-6989586621680917827"><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917827"><span class="hs-identifier hs-var">lits</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ConLike -&gt; PmAltCon) -&gt; [ConLike] -&gt; [PmAltCon]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; PmAltCon
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-var">PmAltConLike</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ConLikeSet -&gt; [ConLike]
forall a. UniqDSet a -&gt; [a]
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetToList"><span class="hs-identifier hs-var">uniqDSetToList</span></a></span><span> </span><span class="annot"><span class="annottext">ConLikeSet
</span><a href="#local-6989586621680917828"><span class="hs-identifier hs-var">cls</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[PmAltCon] -&gt; [PmAltCon] -&gt; [PmAltCon]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(PmLit -&gt; PmAltCon) -&gt; [PmLit] -&gt; [PmAltCon]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit -&gt; PmAltCon
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-var">PmAltLit</span></a></span><span> </span><span class="annot"><span class="annottext">[PmLit]
</span><a href="#local-6989586621680917827"><span class="hs-identifier hs-var">lits</span></a></span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917823"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-187"></span><span>  </span><span id="local-6989586621680917818"><span class="annot"><span class="annottext">ppr :: PmAltConSet -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[PmAltCon] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">([PmAltCon] -&gt; SDoc)
-&gt; (PmAltConSet -&gt; [PmAltCon]) -&gt; PmAltConSet -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PmAltConSet -&gt; [PmAltCon]
</span><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConSetElems"><span class="hs-identifier hs-var">pmAltConSetElems</span></a></span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="hs-comment">-- | We can't in general decide whether two 'PmAltCon's match the same set of</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- values. In addition to the reasons in 'eqPmLit' and 'eqConLike', a</span><span>
</span><span id="line-191"></span><span class="hs-comment">-- 'PmAltConLike' might or might not represent the same value as a 'PmAltLit'.</span><span>
</span><span id="line-192"></span><span class="hs-comment">-- See Note [Undecidable Equality for PmAltCons].</span><span>
</span><span id="line-193"></span><span class="hs-comment">--</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- * @Just True@ ==&gt; Surely equal</span><span>
</span><span id="line-195"></span><span class="hs-comment">-- * @Just False@ ==&gt; Surely different (non-overlapping, even!)</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- * @Nothing@ ==&gt; Equality relation undecidable</span><span>
</span><span id="line-197"></span><span class="hs-comment">--</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- Examples (omitting some constructor wrapping):</span><span>
</span><span id="line-199"></span><span class="hs-comment">--</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- * @eqPmAltCon (LitInt 42) (LitInt 1) == Just False@: Lit equality is</span><span>
</span><span id="line-201"></span><span class="hs-comment">--   decidable</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- * @eqPmAltCon (DataCon A) (DataCon B) == Just False@: DataCon equality is</span><span>
</span><span id="line-203"></span><span class="hs-comment">--   decidable</span><span>
</span><span id="line-204"></span><span class="hs-comment">-- * @eqPmAltCon (LitOverInt 42) (LitOverInt 1) == Nothing@: OverLit equality</span><span>
</span><span id="line-205"></span><span class="hs-comment">--   is undecidable</span><span>
</span><span id="line-206"></span><span class="hs-comment">-- * @eqPmAltCon (PatSyn PA) (PatSyn PB) == Nothing@: PatSyn equality is</span><span>
</span><span id="line-207"></span><span class="hs-comment">--   undecidable</span><span>
</span><span id="line-208"></span><span class="hs-comment">-- * @eqPmAltCon (DataCon I#) (LitInt 1) == Nothing@: DataCon to Lit</span><span>
</span><span id="line-209"></span><span class="hs-comment">--   comparisons are undecidable without reasoning about the wrapped @Int#@</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- * @eqPmAltCon (LitOverInt 1) (LitOverInt 1) == Just True@: We assume</span><span>
</span><span id="line-211"></span><span class="hs-comment">--   reflexivity for overloaded literals</span><span>
</span><span id="line-212"></span><span class="hs-comment">-- * @eqPmAltCon (PatSyn PA) (PatSyn PA) == Just True@: We assume reflexivity</span><span>
</span><span id="line-213"></span><span class="hs-comment">--   for Pattern Synonyms</span><span>
</span><span id="line-214"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqPmAltCon"><span class="hs-identifier hs-type">eqPmAltCon</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier hs-type">PmEquality</span></a></span><span>
</span><span id="line-215"></span><span id="eqPmAltCon"><span class="annot"><span class="annottext">eqPmAltCon :: PmAltCon -&gt; PmAltCon -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqPmAltCon"><span class="hs-identifier hs-var hs-var">eqPmAltCon</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-type">PmAltConLike</span></a></span><span> </span><span id="local-6989586621680917815"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917815"><span class="hs-identifier hs-var">cl1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-type">PmAltConLike</span></a></span><span> </span><span id="local-6989586621680917814"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917814"><span class="hs-identifier hs-var">cl2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; ConLike -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqConLike"><span class="hs-identifier hs-var">eqConLike</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917815"><span class="hs-identifier hs-var">cl1</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917814"><span class="hs-identifier hs-var">cl2</span></a></span><span>
</span><span id="line-216"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqPmAltCon"><span class="hs-identifier hs-var">eqPmAltCon</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-type">PmAltLit</span></a></span><span>     </span><span id="local-6989586621680917813"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917813"><span class="hs-identifier hs-var">l1</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-type">PmAltLit</span></a></span><span>     </span><span id="local-6989586621680917812"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917812"><span class="hs-identifier hs-var">l2</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLit -&gt; PmLit -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqPmLit"><span class="hs-identifier hs-var">eqPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917813"><span class="hs-identifier hs-var">l1</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917812"><span class="hs-identifier hs-var">l2</span></a></span><span>
</span><span id="line-217"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#eqPmAltCon"><span class="hs-identifier hs-var">eqPmAltCon</span></a></span><span> </span><span class="annot"><span class="annottext">PmAltCon
</span><span class="hs-identifier">_</span></span><span>                  </span><span class="annot"><span class="annottext">PmAltCon
</span><span class="hs-identifier">_</span></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#PossiblyOverlap"><span class="hs-identifier hs-var">PossiblyOverlap</span></a></span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span class="hs-comment">-- | Syntactic equality.</span><span>
</span><span id="line-220"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917809"><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-221"></span><span>  </span><span id="local-6989586621680917807"><span class="annot"><span class="annottext">PmAltCon
</span><a href="#local-6989586621680917807"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680917806"><span class="annot"><span class="annottext">== :: PmAltCon -&gt; PmAltCon -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></span></span><span> </span><span id="local-6989586621680917805"><span class="annot"><span class="annottext">PmAltCon
</span><a href="#local-6989586621680917805"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmAltCon -&gt; PmAltCon -&gt; PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#eqPmAltCon"><span class="hs-identifier hs-var">eqPmAltCon</span></a></span><span> </span><span class="annot"><span class="annottext">PmAltCon
</span><a href="#local-6989586621680917807"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">PmAltCon
</span><a href="#local-6989586621680917805"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">PmEquality -&gt; PmEquality -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">PmEquality
</span><a href="GHC.HsToCore.PmCheck.Types.html#Equal"><span class="hs-identifier hs-var">Equal</span></a></span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="hs-comment">-- | Type of a 'PmAltCon'</span><span>
</span><span id="line-224"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConType"><span class="hs-identifier hs-type">pmAltConType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-225"></span><span id="pmAltConType"><span class="annot"><span class="annottext">pmAltConType :: PmAltCon -&gt; [Type] -&gt; Type
</span><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConType"><span class="hs-identifier hs-var hs-var">pmAltConType</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-type">PmAltLit</span></a></span><span> </span><span id="local-6989586621680917804"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917804"><span class="hs-identifier hs-var">lit</span></a></span></span><span class="hs-special">)</span><span>     </span><span id="local-6989586621680917803"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680917803"><span class="hs-identifier hs-var">_arg_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">_arg_tys</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-identifier">pmLitType</span><span> </span><span class="hs-identifier">lit</span><span>
</span><span id="line-226"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmAltConType"><span class="hs-identifier hs-var">pmAltConType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-type">PmAltConLike</span></a></span><span> </span><span id="local-6989586621680917800"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917800"><span class="hs-identifier hs-var">con</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680917799"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680917799"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.ConLike.html#conLikeResTy"><span class="hs-identifier hs-var">conLikeResTy</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917800"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680917799"><span class="hs-identifier hs-var">arg_tys</span></a></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-comment">{- Note [Undecidable Equality for PmAltCons]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Equality on overloaded literals is undecidable in the general case. Consider
the following example:

  instance Num Bool where
    ...
    fromInteger 0 = False -- C-like representation of booleans
    fromInteger _ = True

    f :: Bool -&gt; ()
    f 1 = ()        -- Clause A
    f 2 = ()        -- Clause B

Clause B is redundant but to detect this, we must decide the constraint:
@fromInteger 2 ~ fromInteger 1@ which means that we
have to look through function @fromInteger@, whose implementation could
be anything. This poses difficulties for:

1. The expressive power of the check.
   We cannot expect a reasonable implementation of pattern matching to detect
   that @fromInteger 2 ~ fromInteger 1@ is True, unless we unfold function
   fromInteger. This puts termination at risk and is undecidable in the
   general case.

2. Error messages/Warnings.
   What should our message for @f@ above be? A reasonable approach would be
   to issue:

     Pattern matches are (potentially) redundant:
       f 2 = ...    under the assumption that 1 == 2

   but seems to complex and confusing for the user.

We choose to equate only obviously equal overloaded literals, in all other cases
we signal undecidability by returning Nothing from 'eqPmAltCons'. We do
better for non-overloaded literals, because we know their fromInteger/fromString
implementation is actually injective, allowing us to simplify the constraint
@fromInteger 1 ~ fromInteger 2@ to @1 ~ 2@, which is trivially unsatisfiable.

The impact of this treatment of overloaded literals is the following:

  * Redundancy checking is rather conservative, since it cannot see that clause
    B above is redundant.

  * We have instant equality check for overloaded literals (we do not rely on
    the term oracle which is rather expensive, both in terms of performance and
    memory). This significantly improves the performance of functions `covered`
    `uncovered` and `divergent` in &quot;GHC.HsToCore.PmCheck&quot; and effectively addresses
    #11161.

  * The warnings issued are simpler.

Similar reasoning applies to pattern synonyms: In contrast to data constructors,
which are generative, constraints like F a ~ G b for two different pattern
synonyms F and G aren't immediately unsatisfiable. We assume F a ~ F a, though.
-}</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-type">literalToPmLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Literal.html#Literal"><span class="hs-identifier hs-type">Literal</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span>
</span><span id="line-287"></span><span id="literalToPmLit"><span class="annot"><span class="annottext">literalToPmLit :: Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var hs-var">literalToPmLit</span></a></span></span><span> </span><span id="local-6989586621680917797"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917797"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680917796"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917796"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; PmLitValue -&gt; PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-var">PmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917797"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">(PmLitValue -&gt; PmLit) -&gt; Maybe PmLitValue -&gt; Maybe PmLit
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Maybe PmLitValue
</span><a href="#local-6989586621680917794"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917796"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-288"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-289"></span><span>    </span><span id="local-6989586621680917794"><span class="annot"><span class="annottext">go :: Literal -&gt; Maybe PmLitValue
</span><a href="#local-6989586621680917794"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitChar"><span class="hs-identifier hs-type">LitChar</span></a></span><span> </span><span id="local-6989586621680917792"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917792"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitChar"><span class="hs-identifier hs-var">PmLitChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917792"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>    </span><span class="annot"><a href="#local-6989586621680917794"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitFloat"><span class="hs-identifier hs-type">LitFloat</span></a></span><span> </span><span id="local-6989586621680917790"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917790"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-var">PmLitRat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917790"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-291"></span><span>    </span><span class="annot"><a href="#local-6989586621680917794"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitDouble"><span class="hs-identifier hs-type">LitDouble</span></a></span><span> </span><span id="local-6989586621680917788"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917788"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-var">PmLitRat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917788"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span>    </span><span class="annot"><a href="#local-6989586621680917794"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitString"><span class="hs-identifier hs-type">LitString</span></a></span><span> </span><span id="local-6989586621680917786"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680917786"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-var">PmLitString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringByteString"><span class="hs-identifier hs-var">mkFastStringByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680917786"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>    </span><span class="annot"><a href="#local-6989586621680917794"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Literal.html#LitNumber"><span class="hs-identifier hs-type">LitNumber</span></a></span><span> </span><span class="annot"><span class="annottext">LitNumType
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680917783"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917783"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-var">PmLitInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917783"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>    </span><span class="annot"><a href="#local-6989586621680917794"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe PmLitValue
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-295"></span><span>
</span><span id="line-296"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#negatePmLit"><span class="hs-identifier hs-type">negatePmLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span>
</span><span id="line-297"></span><span id="negatePmLit"><span class="annot"><span class="annottext">negatePmLit :: PmLit -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#negatePmLit"><span class="hs-identifier hs-var hs-var">negatePmLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span id="local-6989586621680917782"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917782"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680917781"><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917781"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; PmLitValue -&gt; PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-var">PmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917782"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">(PmLitValue -&gt; PmLit) -&gt; Maybe PmLitValue -&gt; Maybe PmLit
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
</span><a href="#local-6989586621680917780"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917781"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-298"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-299"></span><span>    </span><span id="local-6989586621680917780"><span class="annot"><span class="annottext">go :: PmLitValue -&gt; Maybe PmLitValue
</span><a href="#local-6989586621680917780"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-type">PmLitInt</span></a></span><span> </span><span id="local-6989586621680917769"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917769"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-var">PmLitInt</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917769"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>    </span><span class="annot"><a href="#local-6989586621680917780"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-type">PmLitRat</span></a></span><span> </span><span id="local-6989586621680917768"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917768"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-var">PmLitRat</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917768"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span>    </span><span class="annot"><a href="#local-6989586621680917780"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-type">PmLitOverInt</span></a></span><span> </span><span id="local-6989586621680917767"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917767"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680917766"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917766"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-var">PmLitOverInt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917767"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917766"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>    </span><span class="annot"><a href="#local-6989586621680917780"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-type">PmLitOverRat</span></a></span><span> </span><span id="local-6989586621680917764"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917764"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680917763"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917763"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Rational -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-var">PmLitOverRat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917764"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917763"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>    </span><span class="annot"><a href="#local-6989586621680917780"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><span class="hs-identifier">_</span></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe PmLitValue
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#overloadPmLit"><span class="hs-identifier hs-type">overloadPmLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span>
</span><span id="line-306"></span><span id="overloadPmLit"><span class="annot"><span class="annottext">overloadPmLit :: Type -&gt; PmLit -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#overloadPmLit"><span class="hs-identifier hs-var hs-var">overloadPmLit</span></a></span></span><span> </span><span id="local-6989586621680917762"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917762"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680917761"><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917761"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; PmLitValue -&gt; PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-var">PmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917762"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">(PmLitValue -&gt; PmLit) -&gt; Maybe PmLitValue -&gt; Maybe PmLit
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
</span><a href="#local-6989586621680917760"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917761"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-308"></span><span>    </span><span id="local-6989586621680917760"><span class="annot"><span class="annottext">go :: PmLitValue -&gt; Maybe PmLitValue
</span><a href="#local-6989586621680917760"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-type">PmLitInt</span></a></span><span> </span><span id="local-6989586621680917759"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917759"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-var">PmLitOverInt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917759"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>    </span><span class="annot"><a href="#local-6989586621680917760"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-type">PmLitRat</span></a></span><span> </span><span id="local-6989586621680917758"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917758"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Rational -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-var">PmLitOverRat</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917758"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span>    </span><span class="annot"><a href="#local-6989586621680917760"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-type">PmLitString</span></a></span><span> </span><span id="local-6989586621680917757"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917757"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917762"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#stringTy"><span class="hs-identifier hs-var">stringTy</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917761"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-312"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; Maybe PmLitValue
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; PmLitValue
</span><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverString"><span class="hs-identifier hs-var">PmLitOverString</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917757"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-313"></span><span>    </span><span class="annot"><a href="#local-6989586621680917760"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><span class="hs-identifier">_</span></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe PmLitValue
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmLitAsStringLit"><span class="hs-identifier hs-type">pmLitAsStringLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-316"></span><span id="pmLitAsStringLit"><span class="annot"><span class="annottext">pmLitAsStringLit :: PmLit -&gt; Maybe FastString
</span><a href="GHC.HsToCore.PmCheck.Types.html#pmLitAsStringLit"><span class="hs-identifier hs-var hs-var">pmLitAsStringLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-type">PmLitString</span></a></span><span> </span><span id="local-6989586621680917755"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917755"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Maybe FastString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917755"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-317"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#pmLitAsStringLit"><span class="hs-identifier hs-var">pmLitAsStringLit</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><span class="hs-identifier">_</span></span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-type">coreExprAsPmLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span>
</span><span id="line-320"></span><span class="hs-comment">-- coreExprAsPmLit e | pprTrace &quot;coreExprAsPmLit&quot; (ppr e) False = undefined</span><span>
</span><span id="line-321"></span><span id="coreExprAsPmLit"><span class="annot"><span class="annottext">coreExprAsPmLit :: CoreExpr -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-var hs-var">coreExprAsPmLit</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Tick"><span class="hs-identifier hs-type">Tick</span></a></span><span> </span><span id="local-6989586621680917753"><span class="annot"><span class="annottext">Tickish Id
</span><a href="#local-6989586621680917753"><span class="hs-identifier hs-var">_t</span></a></span></span><span> </span><span id="local-6989586621680917752"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917752"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-var">coreExprAsPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917752"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-322"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-var">coreExprAsPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680917750"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917750"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var">literalToPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; Type
</span><a href="GHC.Types.Literal.html#literalType"><span class="hs-identifier hs-var">literalType</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917750"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917750"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-323"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-var">coreExprAsPmLit</span></a></span><span> </span><span id="local-6989586621680917748"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; (CoreExpr, [CoreExpr])
forall b. Expr b -&gt; (Expr b, [Expr b])
</span><a href="GHC.Core.html#collectArgs"><span class="hs-identifier hs-var">collectArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-324"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917745"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917745"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680917744"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917744"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680917743"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917743"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe DataCon
</span><a href="GHC.Types.Id.html#isDataConWorkId_maybe"><span class="hs-identifier hs-var">isDataConWorkId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917745"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-326"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917743"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [DataCon] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#intDataCon"><span class="hs-identifier hs-var">intDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#wordDataCon"><span class="hs-identifier hs-var">wordDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#charDataCon"><span class="hs-identifier hs-var">charDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#floatDataCon"><span class="hs-identifier hs-var">floatDataCon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#doubleDataCon"><span class="hs-identifier hs-var">doubleDataCon</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-327"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var">literalToPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917744"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-328"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917736"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917736"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680917735"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917735"><span class="hs-identifier hs-var">_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680917734"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917734"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680917733"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917733"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680917732"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917732"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe DataCon
</span><a href="GHC.Types.Id.html#isDataConWorkId_maybe"><span class="hs-identifier hs-var">isDataConWorkId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917736"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-330"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; Name
</span><a href="GHC.Core.DataCon.html#dataConName"><span class="hs-identifier hs-var">dataConName</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917732"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#ratioDataConName"><span class="hs-identifier hs-var">ratioDataConName</span></a></span><span>
</span><span id="line-331"></span><span>    </span><span class="hs-comment">-- HACK: just assume we have a literal double. This case only occurs for</span><span>
</span><span id="line-332"></span><span>    </span><span class="hs-comment">--       overloaded lits anyway, so we immediately override type information</span><span>
</span><span id="line-333"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var">literalToPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitDouble"><span class="hs-identifier hs-var">mkLitDouble</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; Integer
</span><a href="GHC.Types.Literal.html#litValue"><span class="hs-identifier hs-var">litValue</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917734"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Rational
forall a. Integral a =&gt; a -&gt; a -&gt; Ratio a
</span><a href="../../base/src/GHC.Real.html#%25"><span class="hs-operator hs-var">%</span></a></span><span> </span><span class="annot"><span class="annottext">Literal -&gt; Integer
</span><a href="GHC.Types.Literal.html#litValue"><span class="hs-identifier hs-var">litValue</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917733"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917726"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917726"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680917725"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680917725"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span>    </span><span class="hs-comment">-- Take care of -XRebindableSyntax. The last argument should be the (only)</span><span>
</span><span id="line-336"></span><span>    </span><span class="hs-comment">-- integer literal, otherwise we can't really do much about it.</span><span>
</span><span id="line-337"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680917724"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917724"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; Bool) -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (CoreExpr -&gt; Bool) -&gt; CoreExpr -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Bool
forall {b}. Expr b -&gt; Bool
</span><a href="#local-6989586621680917722"><span class="hs-identifier hs-var">is_lit</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680917725"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-338"></span><span>    </span><span class="hs-comment">-- getOccFS because of -XRebindableSyntax</span><span>
</span><span id="line-339"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; FastString
forall a. NamedThing a =&gt; a -&gt; FastString
</span><a href="GHC.Types.Name.html#getOccFS"><span class="hs-identifier hs-var">getOccFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917726"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name -&gt; FastString
forall a. NamedThing a =&gt; a -&gt; FastString
</span><a href="GHC.Types.Name.html#getOccFS"><span class="hs-identifier hs-var">getOccFS</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#fromIntegerName"><span class="hs-identifier hs-var">fromIntegerName</span></a></span><span>
</span><span id="line-340"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var">literalToPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Literal -&gt; Type
</span><a href="GHC.Types.Literal.html#literalType"><span class="hs-identifier hs-var">literalType</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917724"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917724"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe PmLit -&gt; (PmLit -&gt; Maybe PmLit) -&gt; Maybe PmLit
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; PmLit -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#overloadPmLit"><span class="hs-identifier hs-var">overloadPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917718"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917718"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680917717"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680917717"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-342"></span><span>    </span><span class="hs-comment">-- Similar to fromInteger case</span><span>
</span><span id="line-343"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span id="local-6989586621680917716"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917716"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; Bool) -&gt; [CoreExpr] -&gt; [CoreExpr]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; (CoreExpr -&gt; Bool) -&gt; CoreExpr -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Bool
</span><a href="#local-6989586621680917715"><span class="hs-identifier hs-var">is_ratio</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621680917717"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-344"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; FastString
forall a. NamedThing a =&gt; a -&gt; FastString
</span><a href="GHC.Types.Name.html#getOccFS"><span class="hs-identifier hs-var">getOccFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917718"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name -&gt; FastString
forall a. NamedThing a =&gt; a -&gt; FastString
</span><a href="GHC.Types.Name.html#getOccFS"><span class="hs-identifier hs-var">getOccFS</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#fromRationalName"><span class="hs-identifier hs-var">fromRationalName</span></a></span><span>
</span><span id="line-345"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-var">coreExprAsPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917716"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe PmLit -&gt; (PmLit -&gt; Maybe PmLit) -&gt; Maybe PmLit
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; PmLit -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#overloadPmLit"><span class="hs-identifier hs-var">overloadPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-346"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917713"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917713"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621680917711"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917711"><span class="hs-identifier hs-var">_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680917710"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917710"><span class="hs-identifier hs-var">_dict</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680917709"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917709"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917713"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#fromStringName"><span class="hs-identifier hs-var">fromStringName</span></a></span><span>
</span><span id="line-348"></span><span>    </span><span class="hs-comment">-- NB: Calls coreExprAsPmLit and then overloadPmLit, so that we return PmLitOverStrings</span><span>
</span><span id="line-349"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#coreExprAsPmLit"><span class="hs-identifier hs-var">coreExprAsPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917709"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe PmLit -&gt; (PmLit -&gt; Maybe PmLit) -&gt; Maybe PmLit
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; PmLit -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#overloadPmLit"><span class="hs-identifier hs-var">overloadPmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917748"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-350"></span><span>  </span><span class="hs-comment">-- These last two cases handle String literals</span><span>
</span><span id="line-351"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917707"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917707"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span id="local-6989586621680917706"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917706"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-352"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680917705"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917705"><span class="hs-identifier hs-var">dc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Maybe DataCon
</span><a href="GHC.Types.Id.html#isDataConWorkId_maybe"><span class="hs-identifier hs-var">isDataConWorkId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917707"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-353"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621680917705"><span class="hs-identifier hs-var">dc</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; DataCon -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="GHC.Builtin.Types.html#nilDataCon"><span class="hs-identifier hs-var">nilDataCon</span></a></span><span>
</span><span id="line-354"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917706"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#charTy"><span class="hs-identifier hs-var">charTy</span></a></span><span>
</span><span id="line-355"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var">literalToPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#stringTy"><span class="hs-identifier hs-var">stringTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Literal
</span><a href="GHC.Types.Literal.html#mkLitString"><span class="hs-identifier hs-var">mkLitString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621680917701"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917701"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span> </span><span id="local-6989586621680917700"><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917700"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917701"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unpackCStringName"><span class="hs-identifier hs-var">unpackCStringName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#unpackCStringUtf8Name"><span class="hs-identifier hs-var">unpackCStringUtf8Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-358"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Literal -&gt; Maybe PmLit
</span><a href="GHC.HsToCore.PmCheck.Types.html#literalToPmLit"><span class="hs-identifier hs-var">literalToPmLit</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#stringTy"><span class="hs-identifier hs-var">stringTy</span></a></span><span> </span><span class="annot"><span class="annottext">Literal
</span><a href="#local-6989586621680917700"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-359"></span><span>  </span><span class="annot"><span class="annottext">(CoreExpr, [CoreExpr])
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe PmLit
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-360"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-361"></span><span>    </span><span id="local-6989586621680917722"><span class="annot"><span class="annottext">is_lit :: Expr b -&gt; Bool
</span><a href="#local-6989586621680917722"><span class="hs-identifier hs-var hs-var">is_lit</span></a></span></span><span> </span><span class="annot"><a href="GHC.Core.html#Lit"><span class="hs-identifier hs-type">Lit</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-362"></span><span>    </span><span class="annot"><a href="#local-6989586621680917722"><span class="hs-identifier hs-var">is_lit</span></a></span><span> </span><span class="annot"><span class="annottext">Expr b
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-363"></span><span>    </span><span id="local-6989586621680917715"><span class="annot"><span class="annottext">is_ratio :: CoreExpr -&gt; Bool
</span><a href="#local-6989586621680917715"><span class="hs-identifier hs-var hs-var">is_ratio</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-364"></span><span>    </span><span class="annot"><a href="#local-6989586621680917715"><span class="hs-identifier hs-var">is_ratio</span></a></span><span> </span><span id="local-6989586621680917695"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917695"><span class="hs-identifier hs-var">r</span></a></span></span><span>
</span><span id="line-365"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680917694"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680917694"><span class="hs-identifier hs-var">tc</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Maybe (TyCon, [Type])
Type -&gt; Maybe (TyCon, [Type])
</span><a href="GHC.Core.Type.html#splitTyConApp_maybe"><span class="hs-identifier hs-var">splitTyConApp_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621680917695"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Name
</span><a href="GHC.Core.TyCon.html#tyConName"><span class="hs-identifier hs-var hs-var">tyConName</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680917694"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Name -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#ratioTyConName"><span class="hs-identifier hs-var">ratioTyConName</span></a></span><span>
</span><span id="line-367"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-368"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917688"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitValue"><span class="hs-identifier hs-type">PmLitValue</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-371"></span><span>  </span><span id="local-6989586621680917678"><span class="annot"><span class="annottext">ppr :: PmLitValue -&gt; SDoc
</span><a href="#local-6989586621680917678"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitInt"><span class="hs-identifier hs-type">PmLitInt</span></a></span><span> </span><span id="local-6989586621680917677"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917677"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917677"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-372"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitRat"><span class="hs-identifier hs-type">PmLitRat</span></a></span><span> </span><span id="local-6989586621680917676"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917676"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#double"><span class="hs-identifier hs-var">double</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Double
forall a. RealFloat a =&gt; Rational -&gt; a
</span><a href="../../base/src/GHC.Float.html#fromRat"><span class="hs-identifier hs-var">fromRat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917676"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- good enough</span><span>
</span><span id="line-373"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitChar"><span class="hs-identifier hs-type">PmLitChar</span></a></span><span> </span><span id="local-6989586621680917674"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917674"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprHsChar"><span class="hs-identifier hs-var">pprHsChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680917674"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-374"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitString"><span class="hs-identifier hs-type">PmLitString</span></a></span><span> </span><span id="local-6989586621680917672"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917672"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprHsString"><span class="hs-identifier hs-var">pprHsString</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917672"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-375"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverInt"><span class="hs-identifier hs-type">PmLitOverInt</span></a></span><span> </span><span id="local-6989586621680917670"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917670"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680917669"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917669"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.HsToCore.PmCheck.Types.html#minuses"><span class="hs-identifier hs-var">minuses</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917670"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621680917669"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverRat"><span class="hs-identifier hs-type">PmLitOverRat</span></a></span><span> </span><span id="local-6989586621680917667"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917667"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680917666"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917666"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.HsToCore.PmCheck.Types.html#minuses"><span class="hs-identifier hs-var">minuses</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917667"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#double"><span class="hs-identifier hs-var">double</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; Double
forall a. RealFloat a =&gt; Rational -&gt; a
</span><a href="../../base/src/GHC.Float.html#fromRat"><span class="hs-identifier hs-var">fromRat</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621680917666"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLitOverString"><span class="hs-identifier hs-type">PmLitOverString</span></a></span><span> </span><span id="local-6989586621680917665"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917665"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprHsString"><span class="hs-identifier hs-var">pprHsString</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680917665"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="hs-comment">-- Take care of negated literals</span><span>
</span><span id="line-380"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#minuses"><span class="hs-identifier hs-type">minuses</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-381"></span><span id="minuses"><span class="annot"><span class="annottext">minuses :: Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.HsToCore.PmCheck.Types.html#minuses"><span class="hs-identifier hs-var hs-var">minuses</span></a></span></span><span> </span><span id="local-6989586621680917664"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917664"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621680917663"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680917663"><span class="hs-identifier hs-var">sdoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; [SDoc]
forall a. (a -&gt; a) -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#iterate"><span class="hs-identifier hs-var">iterate</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621680917661"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680917661"><span class="hs-identifier hs-var">sdoc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'-'</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680917661"><span class="hs-identifier hs-var">sdoc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680917663"><span class="hs-identifier hs-var">sdoc</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; Int -&gt; SDoc
forall a. [a] -&gt; Int -&gt; a
</span><a href="../../base/src/GHC.List.html#%21%21"><span class="hs-operator hs-var">!!</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680917664"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917654"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-384"></span><span>  </span><span id="local-6989586621680917652"><span class="annot"><span class="annottext">ppr :: PmLit -&gt; SDoc
</span><a href="#local-6989586621680917652"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmLit"><span class="hs-identifier hs-type">PmLit</span></a></span><span> </span><span id="local-6989586621680917651"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917651"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680917650"><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917650"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLitValue -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PmLitValue
</span><a href="#local-6989586621680917650"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680917649"><span class="hs-identifier hs-var">suffix</span></a></span><span>
</span><span id="line-385"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-386"></span><span>      </span><span class="hs-comment">-- Some ad-hoc hackery for displaying proper lit suffixes based on type</span><span>
</span><span id="line-387"></span><span>      </span><span id="local-6989586621680917648"><span class="annot"><span class="annottext">tbl :: [(Type, SDoc)]
</span><a href="#local-6989586621680917648"><span class="hs-identifier hs-var hs-var">tbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#intPrimTy"><span class="hs-identifier hs-var">intPrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primIntSuffix"><span class="hs-identifier hs-var">primIntSuffix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#int64PrimTy"><span class="hs-identifier hs-var">int64PrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primInt64Suffix"><span class="hs-identifier hs-var">primInt64Suffix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#wordPrimTy"><span class="hs-identifier hs-var">wordPrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primWordSuffix"><span class="hs-identifier hs-var">primWordSuffix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-390"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#word64PrimTy"><span class="hs-identifier hs-var">word64PrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primWord64Suffix"><span class="hs-identifier hs-var">primWord64Suffix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-391"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#charPrimTy"><span class="hs-identifier hs-var">charPrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primCharSuffix"><span class="hs-identifier hs-var">primCharSuffix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#floatPrimTy"><span class="hs-identifier hs-var">floatPrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primFloatSuffix"><span class="hs-identifier hs-var">primFloatSuffix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-393"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.Prim.html#doublePrimTy"><span class="hs-identifier hs-var">doublePrimTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#primDoubleSuffix"><span class="hs-identifier hs-var">primDoubleSuffix</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-394"></span><span>      </span><span id="local-6989586621680917649"><span class="annot"><span class="annottext">suffix :: SDoc
</span><a href="#local-6989586621680917649"><span class="hs-identifier hs-var hs-var">suffix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Maybe SDoc -&gt; SDoc
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Type, SDoc) -&gt; SDoc
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((Type, SDoc) -&gt; SDoc) -&gt; Maybe (Type, SDoc) -&gt; Maybe SDoc
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">((Type, SDoc) -&gt; Bool) -&gt; [(Type, SDoc)] -&gt; Maybe (Type, SDoc)
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Maybe a
</span><a href="../../base/src/Data.Foldable.html#find"><span class="hs-identifier hs-var">find</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-identifier hs-var">eqType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917651"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; Bool) -&gt; ((Type, SDoc) -&gt; Type) -&gt; (Type, SDoc) -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Type, SDoc) -&gt; Type
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Type, SDoc)]
</span><a href="#local-6989586621680917648"><span class="hs-identifier hs-var">tbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917627"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-397"></span><span>  </span><span id="local-6989586621680917623"><span class="annot"><span class="annottext">ppr :: PmAltCon -&gt; SDoc
</span><a href="#local-6989586621680917623"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConLike"><span class="hs-identifier hs-type">PmAltConLike</span></a></span><span> </span><span id="local-6989586621680917622"><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917622"><span class="hs-identifier hs-var">cl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConLike -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ConLike
</span><a href="#local-6989586621680917622"><span class="hs-identifier hs-var">cl</span></a></span><span>
</span><span id="line-398"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltLit"><span class="hs-identifier hs-type">PmAltLit</span></a></span><span> </span><span id="local-6989586621680917621"><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917621"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PmLit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PmLit
</span><a href="#local-6989586621680917621"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917618"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmEquality"><span class="hs-identifier hs-type">PmEquality</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-401"></span><span>  </span><span id="local-6989586621680917616"><span class="annot"><span class="annottext">ppr :: PmEquality -&gt; SDoc
</span><a href="#local-6989586621680917616"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; (PmEquality -&gt; String) -&gt; PmEquality -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PmEquality -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span class="hs-keyword">type</span><span> </span><span id="ConLikeSet"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#ConLikeSet"><span class="hs-identifier hs-var">ConLikeSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DSet.html#UniqDSet"><span class="hs-identifier hs-type">UniqDSet</span></a></span><span> </span><span class="annot"><a href="GHC.Core.ConLike.html#ConLike"><span class="hs-identifier hs-type">ConLike</span></a></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="hs-comment">-- | A data type caching the results of 'completeMatchConLikes' with support for</span><span>
</span><span id="line-406"></span><span class="hs-comment">-- deletion of constructors that were already matched on.</span><span>
</span><span id="line-407"></span><span class="hs-keyword">data</span><span> </span><span id="PossibleMatches"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PossibleMatches"><span class="hs-identifier hs-var">PossibleMatches</span></a></span></span><span>
</span><span id="line-408"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="PM"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PM"><span class="hs-identifier hs-var">PM</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty.NonEmpty</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#ConLikeSet"><span class="hs-identifier hs-type">ConLikeSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>  </span><span class="hs-comment">-- ^ Each ConLikeSet is a (subset of) the constructors in a COMPLETE set</span><span>
</span><span id="line-410"></span><span>  </span><span class="hs-comment">-- 'NonEmpty' because the empty case would mean that the type has no COMPLETE</span><span>
</span><span id="line-411"></span><span>  </span><span class="hs-comment">-- set at all, for which we have 'NoPM'.</span><span>
</span><span id="line-412"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NoPM"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#NoPM"><span class="hs-identifier hs-var">NoPM</span></a></span></span><span>
</span><span id="line-413"></span><span>  </span><span class="hs-comment">-- ^ No COMPLETE set for this type (yet). Think of overloaded literals.</span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917609"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PossibleMatches"><span class="hs-identifier hs-type">PossibleMatches</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-416"></span><span>  </span><span id="local-6989586621680917604"><span class="annot"><span class="annottext">ppr :: PossibleMatches -&gt; SDoc
</span><a href="#local-6989586621680917604"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PM"><span class="hs-identifier hs-type">PM</span></a></span><span> </span><span id="local-6989586621680917603"><span class="annot"><span class="annottext">NonEmpty ConLikeSet
</span><a href="#local-6989586621680917603"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ConLikeSet] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NonEmpty ConLikeSet -&gt; [ConLikeSet]
forall a. NonEmpty a -&gt; [a]
</span><a href="../../base/src/Data.List.NonEmpty.html#toList"><span class="hs-identifier hs-var">NonEmpty.toList</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty ConLikeSet
</span><a href="#local-6989586621680917603"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-417"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PossibleMatches
</span><a href="GHC.HsToCore.PmCheck.Types.html#NoPM"><span class="hs-identifier hs-var">NoPM</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;NoPM&gt;&quot;</span></span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span class="hs-comment">-- | Either @Indirect x@, meaning the value is represented by that of @x@, or</span><span>
</span><span id="line-420"></span><span class="hs-comment">-- an @Entry@ containing containing the actual value it represents.</span><span>
</span><span id="line-421"></span><span class="hs-keyword">data</span><span> </span><span id="Shared"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Shared"><span class="hs-identifier hs-var">Shared</span></a></span></span><span> </span><span id="local-6989586621680918086"><span class="annot"><a href="#local-6989586621680918086"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-422"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Indirect"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Indirect"><span class="hs-identifier hs-var">Indirect</span></a></span></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-423"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Entry"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Entry"><span class="hs-identifier hs-var">Entry</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621680918086"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-424"></span><span>
</span><span id="line-425"></span><span class="hs-comment">-- | A 'DIdEnv' in which entries can be shared by multiple 'Id's.</span><span>
</span><span id="line-426"></span><span class="hs-comment">-- Merge equivalence classes of two Ids by 'setIndirectSDIE' and set the entry</span><span>
</span><span id="line-427"></span><span class="hs-comment">-- of an Id with 'setEntrySDIE'.</span><span>
</span><span id="line-428"></span><span class="hs-keyword">newtype</span><span> </span><span id="SharedDIdEnv"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-var">SharedDIdEnv</span></a></span></span><span> </span><span id="local-6989586621680918106"><span class="annot"><a href="#local-6989586621680918106"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-429"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="SDIE"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-var">SDIE</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="unSDIE"><span class="annot"><span class="annottext">forall a. SharedDIdEnv a -&gt; DIdEnv (Shared a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#unSDIE"><span class="hs-identifier hs-var hs-var">unSDIE</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#DIdEnv"><span class="hs-identifier hs-type">DIdEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Shared"><span class="hs-identifier hs-type">Shared</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918106"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span id="local-6989586621680918103"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#emptySDIE"><span class="hs-identifier hs-type">emptySDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918103"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-432"></span><span id="emptySDIE"><span class="annot"><span class="annottext">emptySDIE :: forall a. SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#emptySDIE"><span class="hs-identifier hs-var hs-var">emptySDIE</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; SharedDIdEnv a
forall a. DIdEnv (Shared a) -&gt; SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-var">SDIE</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a)
forall a. DVarEnv a
</span><a href="GHC.Types.Var.Env.html#emptyDVarEnv"><span class="hs-identifier hs-var">emptyDVarEnv</span></a></span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span id="local-6989586621680918099"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-type">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918099"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918099"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-435"></span><span id="lookupReprAndEntrySDIE"><span class="annot"><span class="annottext">lookupReprAndEntrySDIE :: forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var hs-var">lookupReprAndEntrySDIE</span></a></span></span><span> </span><span id="local-6989586621680917595"><span class="annot"><span class="annottext">sdie :: SharedDIdEnv a
</span><a href="#local-6989586621680917595"><span class="hs-identifier hs-var">sdie</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-type">SDIE</span></a></span><span> </span><span id="local-6989586621680917594"><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917594"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680917593"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917593"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; Id -&gt; Maybe (Shared a)
forall a. DVarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupDVarEnv"><span class="hs-identifier hs-var">lookupDVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917594"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917593"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-436"></span><span>  </span><span class="annot"><span class="annottext">Maybe (Shared a)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917593"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-437"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Indirect"><span class="hs-identifier hs-type">Indirect</span></a></span><span> </span><span id="local-6989586621680917591"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917591"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917595"><span class="hs-identifier hs-var">sdie</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917591"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-438"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Entry"><span class="hs-identifier hs-type">Entry</span></a></span><span> </span><span id="local-6989586621680917590"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917590"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917593"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; Maybe a
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917590"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="hs-comment">-- | @lookupSDIE env x@ looks up an entry for @x@, looking through all</span><span>
</span><span id="line-441"></span><span class="hs-comment">-- 'Indirect's until it finds a shared 'Entry'.</span><span>
</span><span id="line-442"></span><span id="local-6989586621680918096"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#lookupSDIE"><span class="hs-identifier hs-type">lookupSDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918096"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918096"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-443"></span><span id="lookupSDIE"><span class="annot"><span class="annottext">lookupSDIE :: forall a. SharedDIdEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupSDIE"><span class="hs-identifier hs-var hs-var">lookupSDIE</span></a></span></span><span> </span><span id="local-6989586621680917589"><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917589"><span class="hs-identifier hs-var">sdie</span></a></span></span><span> </span><span id="local-6989586621680917588"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917588"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id, Maybe a) -&gt; Maybe a
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917589"><span class="hs-identifier hs-var">sdie</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917588"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="hs-comment">-- | Check if two variables are part of the same equivalence class.</span><span>
</span><span id="line-446"></span><span id="local-6989586621680918094"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#sameRepresentativeSDIE"><span class="hs-identifier hs-type">sameRepresentativeSDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918094"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-447"></span><span id="sameRepresentativeSDIE"><span class="annot"><span class="annottext">sameRepresentativeSDIE :: forall a. SharedDIdEnv a -&gt; Id -&gt; Id -&gt; Bool
</span><a href="GHC.HsToCore.PmCheck.Types.html#sameRepresentativeSDIE"><span class="hs-identifier hs-var hs-var">sameRepresentativeSDIE</span></a></span></span><span> </span><span id="local-6989586621680917585"><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917585"><span class="hs-identifier hs-var">sdie</span></a></span></span><span> </span><span id="local-6989586621680917584"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917584"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680917583"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917583"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-448"></span><span>  </span><span class="annot"><span class="annottext">(Id, Maybe a) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917585"><span class="hs-identifier hs-var">sdie</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917584"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">(Id, Maybe a) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917585"><span class="hs-identifier hs-var">sdie</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917583"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-449"></span><span>
</span><span id="line-450"></span><span class="hs-comment">-- | @setIndirectSDIE env x y@ sets @x@'s 'Entry' to @Indirect y@, thereby</span><span>
</span><span id="line-451"></span><span class="hs-comment">-- merging @x@'s equivalence class into @y@'s. This will discard all info on</span><span>
</span><span id="line-452"></span><span class="hs-comment">-- @x@!</span><span>
</span><span id="line-453"></span><span id="local-6989586621680918092"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#setIndirectSDIE"><span class="hs-identifier hs-type">setIndirectSDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918092"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918092"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-454"></span><span id="setIndirectSDIE"><span class="annot"><span class="annottext">setIndirectSDIE :: forall a. SharedDIdEnv a -&gt; Id -&gt; Id -&gt; SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#setIndirectSDIE"><span class="hs-identifier hs-var hs-var">setIndirectSDIE</span></a></span></span><span> </span><span id="local-6989586621680917582"><span class="annot"><span class="annottext">sdie :: SharedDIdEnv a
</span><a href="#local-6989586621680917582"><span class="hs-identifier hs-var">sdie</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-type">SDIE</span></a></span><span> </span><span id="local-6989586621680917581"><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917581"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680917580"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917580"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680917579"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917579"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-455"></span><span>  </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; SharedDIdEnv a
forall a. DIdEnv (Shared a) -&gt; SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-var">SDIE</span></a></span><span> </span><span class="annot"><span class="annottext">(DIdEnv (Shared a) -&gt; SharedDIdEnv a)
-&gt; DIdEnv (Shared a) -&gt; SharedDIdEnv a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; Id -&gt; Shared a -&gt; DIdEnv (Shared a)
forall a. DVarEnv a -&gt; Id -&gt; a -&gt; DVarEnv a
</span><a href="GHC.Types.Var.Env.html#extendDVarEnv"><span class="hs-identifier hs-var">extendDVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917581"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id, Maybe a) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917582"><span class="hs-identifier hs-var">sdie</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917580"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Shared a
forall a. Id -&gt; Shared a
</span><a href="GHC.HsToCore.PmCheck.Types.html#Indirect"><span class="hs-identifier hs-var">Indirect</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917579"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="hs-comment">-- | @setEntrySDIE env x a@ sets the 'Entry' @x@ is associated with to @a@,</span><span>
</span><span id="line-458"></span><span class="hs-comment">-- thereby modifying its whole equivalence class.</span><span>
</span><span id="line-459"></span><span id="local-6989586621680918085"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#setEntrySDIE"><span class="hs-identifier hs-type">setEntrySDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918085"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680918085"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918085"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-460"></span><span id="setEntrySDIE"><span class="annot"><span class="annottext">setEntrySDIE :: forall a. SharedDIdEnv a -&gt; Id -&gt; a -&gt; SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#setEntrySDIE"><span class="hs-identifier hs-var hs-var">setEntrySDIE</span></a></span></span><span> </span><span id="local-6989586621680917577"><span class="annot"><span class="annottext">sdie :: SharedDIdEnv a
</span><a href="#local-6989586621680917577"><span class="hs-identifier hs-var">sdie</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-type">SDIE</span></a></span><span> </span><span id="local-6989586621680917576"><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917576"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680917575"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917575"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680917574"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917574"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-461"></span><span>  </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; SharedDIdEnv a
forall a. DIdEnv (Shared a) -&gt; SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-var">SDIE</span></a></span><span> </span><span class="annot"><span class="annottext">(DIdEnv (Shared a) -&gt; SharedDIdEnv a)
-&gt; DIdEnv (Shared a) -&gt; SharedDIdEnv a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; Id -&gt; Shared a -&gt; DIdEnv (Shared a)
forall a. DVarEnv a -&gt; Id -&gt; a -&gt; DVarEnv a
</span><a href="GHC.Types.Var.Env.html#extendDVarEnv"><span class="hs-identifier hs-var">extendDVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917576"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id, Maybe a) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
forall a. SharedDIdEnv a -&gt; Id -&gt; (Id, Maybe a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#lookupReprAndEntrySDIE"><span class="hs-identifier hs-var">lookupReprAndEntrySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a
</span><a href="#local-6989586621680917577"><span class="hs-identifier hs-var">sdie</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917575"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Shared a
forall a. a -&gt; Shared a
</span><a href="GHC.HsToCore.PmCheck.Types.html#Entry"><span class="hs-identifier hs-var">Entry</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917574"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#traverseSDIE"><span class="hs-identifier hs-type">traverseSDIE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621680918082"><span class="annot"><a href="#local-6989586621680918082"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span id="local-6989586621680918081"><span class="annot"><a href="#local-6989586621680918081"><span class="hs-identifier hs-type">b</span></a></span></span><span> </span><span id="local-6989586621680918083"><span class="annot"><a href="#local-6989586621680918083"><span class="hs-identifier hs-type">f</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918083"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680918082"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680918083"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918081"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918082"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680918083"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918081"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span id="traverseSDIE"><span class="annot"><span class="annottext">traverseSDIE :: forall a b (f :: * -&gt; *).
Applicative f =&gt;
(a -&gt; f b) -&gt; SharedDIdEnv a -&gt; f (SharedDIdEnv b)
</span><a href="GHC.HsToCore.PmCheck.Types.html#traverseSDIE"><span class="hs-identifier hs-var hs-var">traverseSDIE</span></a></span></span><span> </span><span id="local-6989586621680917564"><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680917564"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([(Unique, Shared b)] -&gt; SharedDIdEnv b)
-&gt; f [(Unique, Shared b)] -&gt; f (SharedDIdEnv b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DIdEnv (Shared b) -&gt; SharedDIdEnv b
forall a. DIdEnv (Shared a) -&gt; SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-var">SDIE</span></a></span><span> </span><span class="annot"><span class="annottext">(DIdEnv (Shared b) -&gt; SharedDIdEnv b)
-&gt; ([(Unique, Shared b)] -&gt; DIdEnv (Shared b))
-&gt; [(Unique, Shared b)]
-&gt; SharedDIdEnv b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unique, Shared b)] -&gt; DIdEnv (Shared b)
forall elt key. [(Unique, elt)] -&gt; UniqDFM key elt
</span><a href="GHC.Types.Unique.DFM.html#listToUDFM_Directly"><span class="hs-identifier hs-var">listToUDFM_Directly</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(f [(Unique, Shared b)] -&gt; f (SharedDIdEnv b))
-&gt; (SharedDIdEnv a -&gt; f [(Unique, Shared b)])
-&gt; SharedDIdEnv a
-&gt; f (SharedDIdEnv b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((Unique, Shared a) -&gt; f (Unique, Shared b))
-&gt; [(Unique, Shared a)] -&gt; f [(Unique, Shared b)]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique, Shared a) -&gt; f (Unique, Shared b)
</span><a href="#local-6989586621680917561"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">([(Unique, Shared a)] -&gt; f [(Unique, Shared b)])
-&gt; (SharedDIdEnv a -&gt; [(Unique, Shared a)])
-&gt; SharedDIdEnv a
-&gt; f [(Unique, Shared b)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UniqDFM Id (Shared a) -&gt; [(Unique, Shared a)]
forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var">udfmToList</span></a></span><span> </span><span class="annot"><span class="annottext">(UniqDFM Id (Shared a) -&gt; [(Unique, Shared a)])
-&gt; (SharedDIdEnv a -&gt; UniqDFM Id (Shared a))
-&gt; SharedDIdEnv a
-&gt; [(Unique, Shared a)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv a -&gt; UniqDFM Id (Shared a)
forall a. SharedDIdEnv a -&gt; DIdEnv (Shared a)
</span><a href="GHC.HsToCore.PmCheck.Types.html#unSDIE"><span class="hs-identifier hs-var hs-var">unSDIE</span></a></span><span>
</span><span id="line-465"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-466"></span><span>    </span><span class="annot"><a href="#local-6989586621680917561"><span class="hs-identifier hs-type">g</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Shared"><span class="hs-identifier hs-type">Shared</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918082"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680918083"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Shared"><span class="hs-identifier hs-type">Shared</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918081"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-467"></span><span>    </span><span id="local-6989586621680917561"><span class="annot"><span class="annottext">g :: (Unique, Shared a) -&gt; f (Unique, Shared b)
</span><a href="#local-6989586621680917561"><span class="hs-identifier hs-var hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680917559"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680917559"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Indirect"><span class="hs-identifier hs-type">Indirect</span></a></span><span> </span><span id="local-6989586621680917558"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917558"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Unique, Shared b) -&gt; f (Unique, Shared b)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680917559"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Id -&gt; Shared b
forall a. Id -&gt; Shared a
</span><a href="GHC.HsToCore.PmCheck.Types.html#Indirect"><span class="hs-identifier hs-var">Indirect</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917558"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-468"></span><span>    </span><span class="annot"><a href="#local-6989586621680917561"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680917557"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680917557"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Entry"><span class="hs-identifier hs-type">Entry</span></a></span><span> </span><span id="local-6989586621680917556"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917556"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-469"></span><span>        </span><span id="local-6989586621680917555"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680917555"><span class="hs-identifier hs-var">a'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680917564"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917556"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-470"></span><span>        </span><span class="hs-identifier">pure</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621680917557"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b -&gt; Shared b
forall a. a -&gt; Shared a
</span><a href="GHC.HsToCore.PmCheck.Types.html#Entry"><span class="hs-identifier hs-var">Entry</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621680917555"><span class="hs-identifier hs-var">a'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-471"></span><span>
</span><span id="line-472"></span><span id="local-6989586621680918062"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917552"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918062"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Shared"><span class="hs-identifier hs-type">Shared</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918062"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-473"></span><span>  </span><span id="local-6989586621680917548"><span class="annot"><span class="annottext">ppr :: Shared a -&gt; SDoc
</span><a href="#local-6989586621680917548"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Indirect"><span class="hs-identifier hs-type">Indirect</span></a></span><span> </span><span id="local-6989586621680917547"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917547"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621680917547"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-474"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Entry"><span class="hs-identifier hs-type">Entry</span></a></span><span> </span><span id="local-6989586621680917546"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917546"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680917546"><span class="hs-identifier hs-var">a</span></a></span></span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span id="local-6989586621680918061"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917543"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918061"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918061"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-477"></span><span>  </span><span id="local-6989586621680917539"><span class="annot"><span class="annottext">ppr :: SharedDIdEnv a -&gt; SDoc
</span><a href="#local-6989586621680917539"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SDIE"><span class="hs-identifier hs-type">SDIE</span></a></span><span> </span><span id="local-6989586621680917538"><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917538"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">DIdEnv (Shared a)
</span><a href="#local-6989586621680917538"><span class="hs-identifier hs-var">env</span></a></span></span><span>
</span><span id="line-478"></span><span>
</span><span id="line-479"></span><span class="hs-comment">-- | The term oracle state. Stores 'VarInfo' for encountered 'Id's. These</span><span>
</span><span id="line-480"></span><span class="hs-comment">-- entries are possibly shared when we figure out that two variables must be</span><span>
</span><span id="line-481"></span><span class="hs-comment">-- equal, thus represent the same set of values.</span><span>
</span><span id="line-482"></span><span class="hs-comment">--</span><span>
</span><span id="line-483"></span><span class="hs-comment">-- See Note [TmState invariants] in &quot;GHC.HsToCore.PmCheck.Oracle&quot;.</span><span>
</span><span id="line-484"></span><span class="hs-keyword">data</span><span> </span><span id="TmState"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmState"><span class="hs-identifier hs-var">TmState</span></a></span></span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="TmSt"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmSt"><span class="hs-identifier hs-var">TmSt</span></a></span></span><span>
</span><span id="line-486"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="ts_facts"><span class="annot"><span class="annottext">TmState -&gt; SharedDIdEnv VarInfo
</span><a href="GHC.HsToCore.PmCheck.Types.html#ts_facts"><span class="hs-identifier hs-var hs-var">ts_facts</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#SharedDIdEnv"><span class="hs-identifier hs-type">SharedDIdEnv</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#VarInfo"><span class="hs-identifier hs-type">VarInfo</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-487"></span><span>  </span><span class="hs-comment">-- ^ Facts about term variables. Deterministic env, so that we generate</span><span>
</span><span id="line-488"></span><span>  </span><span class="hs-comment">-- deterministic error messages.</span><span>
</span><span id="line-489"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="ts_reps"><span class="annot"><span class="annottext">TmState -&gt; CoreMap Id
</span><a href="GHC.HsToCore.PmCheck.Types.html#ts_reps"><span class="hs-identifier hs-var hs-var">ts_reps</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Map.html#CoreMap"><span class="hs-identifier hs-type">CoreMap</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-490"></span><span>  </span><span class="hs-comment">-- ^ An environment for looking up whether we already encountered semantically</span><span>
</span><span id="line-491"></span><span>  </span><span class="hs-comment">-- equivalent expressions that we want to represent by the same 'Id'</span><span>
</span><span id="line-492"></span><span>  </span><span class="hs-comment">-- representative.</span><span>
</span><span id="line-493"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-494"></span><span>
</span><span id="line-495"></span><span class="hs-comment">-- | Information about an 'Id'. Stores positive ('vi_pos') facts, like @x ~ Just 42@,</span><span>
</span><span id="line-496"></span><span class="hs-comment">-- and negative ('vi_neg') facts, like &quot;x is not (:)&quot;.</span><span>
</span><span id="line-497"></span><span class="hs-comment">-- Also caches the type ('vi_ty'), the 'PossibleMatches' of a COMPLETE set</span><span>
</span><span id="line-498"></span><span class="hs-comment">-- ('vi_cache').</span><span>
</span><span id="line-499"></span><span class="hs-comment">--</span><span>
</span><span id="line-500"></span><span class="hs-comment">-- Subject to Note [The Pos/Neg invariant] in &quot;GHC.HsToCore.PmCheck.Oracle&quot;.</span><span>
</span><span id="line-501"></span><span class="hs-keyword">data</span><span> </span><span id="VarInfo"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#VarInfo"><span class="hs-identifier hs-var">VarInfo</span></a></span></span><span>
</span><span id="line-502"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="VI"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#VI"><span class="hs-identifier hs-var">VI</span></a></span></span><span>
</span><span id="line-503"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="vi_ty"><span class="annot"><span class="annottext">VarInfo -&gt; Type
</span><a href="GHC.HsToCore.PmCheck.Types.html#vi_ty"><span class="hs-identifier hs-var hs-var">vi_ty</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-504"></span><span>  </span><span class="hs-comment">-- ^ The type of the variable. Important for rejecting possible GADT</span><span>
</span><span id="line-505"></span><span>  </span><span class="hs-comment">-- constructors or incompatible pattern synonyms (@Just42 :: Maybe Int@).</span><span>
</span><span id="line-506"></span><span>
</span><span id="line-507"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="vi_pos"><span class="annot"><span class="annottext">VarInfo -&gt; [(PmAltCon, [Id], [Id])]
</span><a href="GHC.HsToCore.PmCheck.Types.html#vi_pos"><span class="hs-identifier hs-var hs-var">vi_pos</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltCon"><span class="hs-identifier hs-type">PmAltCon</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-508"></span><span>  </span><span class="hs-comment">-- ^ Positive info: 'PmAltCon' apps it is (i.e. @x ~ [Just y, PatSyn z]@), all</span><span>
</span><span id="line-509"></span><span>  </span><span class="hs-comment">-- at the same time (i.e. conjunctive).  We need a list because of nested</span><span>
</span><span id="line-510"></span><span>  </span><span class="hs-comment">-- pattern matches involving pattern synonym</span><span>
</span><span id="line-511"></span><span>  </span><span class="hs-comment">--    case x of { Just y -&gt; case x of PatSyn z -&gt; ... }</span><span>
</span><span id="line-512"></span><span>  </span><span class="hs-comment">-- However, no more than one RealDataCon in the list, otherwise contradiction</span><span>
</span><span id="line-513"></span><span>  </span><span class="hs-comment">-- because of generativity.</span><span>
</span><span id="line-514"></span><span>
</span><span id="line-515"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="vi_neg"><span class="annot"><span class="annottext">VarInfo -&gt; PmAltConSet
</span><a href="GHC.HsToCore.PmCheck.Types.html#vi_neg"><span class="hs-identifier hs-var hs-var">vi_neg</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PmAltConSet"><span class="hs-identifier hs-type">PmAltConSet</span></a></span><span>
</span><span id="line-516"></span><span>  </span><span class="hs-comment">-- ^ Negative info: A list of 'PmAltCon's that it cannot match.</span><span>
</span><span id="line-517"></span><span>  </span><span class="hs-comment">-- Example, assuming</span><span>
</span><span id="line-518"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-519"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-520"></span><span>  </span><span class="hs-comment">--     data T = Leaf Int | Branch T T | Node Int T</span><span>
</span><span id="line-521"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-522"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-523"></span><span>  </span><span class="hs-comment">-- then @x /~ [Leaf, Node]@ means that @x@ cannot match a @Leaf@ or @Node@,</span><span>
</span><span id="line-524"></span><span>  </span><span class="hs-comment">-- and hence can only match @Branch@. Is orthogonal to anything from 'vi_pos',</span><span>
</span><span id="line-525"></span><span>  </span><span class="hs-comment">-- in the sense that 'eqPmAltCon' returns @PossiblyOverlap@ for any pairing</span><span>
</span><span id="line-526"></span><span>  </span><span class="hs-comment">-- between 'vi_pos' and 'vi_neg'.</span><span>
</span><span id="line-527"></span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-comment">-- See Note [Why record both positive and negative info?]</span><span>
</span><span id="line-529"></span><span>  </span><span class="hs-comment">-- It's worth having an actual set rather than a simple association list,</span><span>
</span><span id="line-530"></span><span>  </span><span class="hs-comment">-- because files like Cabal's `LicenseId` define relatively huge enums</span><span>
</span><span id="line-531"></span><span>  </span><span class="hs-comment">-- that lead to quadratic or worse behavior.</span><span>
</span><span id="line-532"></span><span>
</span><span id="line-533"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="vi_cache"><span class="annot"><span class="annottext">VarInfo -&gt; PossibleMatches
</span><a href="GHC.HsToCore.PmCheck.Types.html#vi_cache"><span class="hs-identifier hs-var hs-var">vi_cache</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#PossibleMatches"><span class="hs-identifier hs-type">PossibleMatches</span></a></span><span>
</span><span id="line-534"></span><span>  </span><span class="hs-comment">-- ^ A cache of the associated COMPLETE sets. At any time a superset of</span><span>
</span><span id="line-535"></span><span>  </span><span class="hs-comment">-- possible constructors of each COMPLETE set. So, if it's not in here, we</span><span>
</span><span id="line-536"></span><span>  </span><span class="hs-comment">-- can't possibly match on it. Complementary to 'vi_neg'. We still need it</span><span>
</span><span id="line-537"></span><span>  </span><span class="hs-comment">-- to recognise completion of a COMPLETE set efficiently for large enums.</span><span>
</span><span id="line-538"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-539"></span><span>
</span><span id="line-540"></span><span class="hs-comment">-- | Not user-facing.</span><span>
</span><span id="line-541"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917526"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmState"><span class="hs-identifier hs-type">TmState</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-542"></span><span>  </span><span id="local-6989586621680917520"><span class="annot"><span class="annottext">ppr :: TmState -&gt; SDoc
</span><a href="#local-6989586621680917520"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmSt"><span class="hs-identifier hs-type">TmSt</span></a></span><span> </span><span id="local-6989586621680917519"><span class="annot"><span class="annottext">SharedDIdEnv VarInfo
</span><a href="#local-6989586621680917519"><span class="hs-identifier hs-var">state</span></a></span></span><span> </span><span id="local-6989586621680917518"><span class="annot"><span class="annottext">CoreMap Id
</span><a href="#local-6989586621680917518"><span class="hs-identifier hs-var">reps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv VarInfo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv VarInfo
</span><a href="#local-6989586621680917519"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">CoreMap Id -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreMap Id
</span><a href="#local-6989586621680917518"><span class="hs-identifier hs-var">reps</span></a></span><span>
</span><span id="line-543"></span><span>
</span><span id="line-544"></span><span class="hs-comment">-- | Not user-facing.</span><span>
</span><span id="line-545"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917514"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#VarInfo"><span class="hs-identifier hs-type">VarInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-546"></span><span>  </span><span id="local-6989586621680917502"><span class="annot"><span class="annottext">ppr :: VarInfo -&gt; SDoc
</span><a href="#local-6989586621680917502"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#VI"><span class="hs-identifier hs-type">VI</span></a></span><span> </span><span id="local-6989586621680917501"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917501"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680917500"><span class="annot"><span class="annottext">[(PmAltCon, [Id], [Id])]
</span><a href="#local-6989586621680917500"><span class="hs-identifier hs-var">pos</span></a></span></span><span> </span><span id="local-6989586621680917499"><span class="annot"><span class="annottext">PmAltConSet
</span><a href="#local-6989586621680917499"><span class="hs-identifier hs-var">neg</span></a></span></span><span> </span><span id="local-6989586621680917498"><span class="annot"><span class="annottext">PossibleMatches
</span><a href="#local-6989586621680917498"><span class="hs-identifier hs-var">cache</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-547"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hcat"><span class="hs-identifier hs-var">hcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680917501"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(PmAltCon, [Id], [Id])] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[(PmAltCon, [Id], [Id])]
</span><a href="#local-6989586621680917500"><span class="hs-identifier hs-var">pos</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PmAltConSet -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PmAltConSet
</span><a href="#local-6989586621680917499"><span class="hs-identifier hs-var">neg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PossibleMatches -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">PossibleMatches
</span><a href="#local-6989586621680917498"><span class="hs-identifier hs-var">cache</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-548"></span><span>
</span><span id="line-549"></span><span class="hs-comment">-- | Initial state of the term oracle.</span><span>
</span><span id="line-550"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#initTmState"><span class="hs-identifier hs-type">initTmState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmState"><span class="hs-identifier hs-type">TmState</span></a></span><span>
</span><span id="line-551"></span><span id="initTmState"><span class="annot"><span class="annottext">initTmState :: TmState
</span><a href="GHC.HsToCore.PmCheck.Types.html#initTmState"><span class="hs-identifier hs-var hs-var">initTmState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv VarInfo -&gt; CoreMap Id -&gt; TmState
</span><a href="GHC.HsToCore.PmCheck.Types.html#TmSt"><span class="hs-identifier hs-var">TmSt</span></a></span><span> </span><span class="annot"><span class="annottext">SharedDIdEnv VarInfo
forall a. SharedDIdEnv a
</span><a href="GHC.HsToCore.PmCheck.Types.html#emptySDIE"><span class="hs-identifier hs-var">emptySDIE</span></a></span><span> </span><span class="annot"><span class="annottext">CoreMap Id
forall a. CoreMap a
</span><a href="GHC.Core.Map.html#emptyCoreMap"><span class="hs-identifier hs-var">emptyCoreMap</span></a></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span class="hs-comment">-- | The type oracle state. A poor man's 'GHC.Tc.Solver.Monad.InsertSet': The invariant is</span><span>
</span><span id="line-554"></span><span class="hs-comment">-- that all constraints in there are mutually compatible.</span><span>
</span><span id="line-555"></span><span class="hs-keyword">newtype</span><span> </span><span id="TyState"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TyState"><span class="hs-identifier hs-var">TyState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="TySt"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TySt"><span class="hs-identifier hs-var">TySt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span class="hs-comment">-- | Not user-facing.</span><span>
</span><span id="line-558"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917488"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TyState"><span class="hs-identifier hs-type">TyState</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-559"></span><span>  </span><span id="local-6989586621680917486"><span class="annot"><span class="annottext">ppr :: TyState -&gt; SDoc
</span><a href="#local-6989586621680917486"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TySt"><span class="hs-identifier hs-type">TySt</span></a></span><span> </span><span id="local-6989586621680917485"><span class="annot"><span class="annottext">Bag Id
</span><a href="#local-6989586621680917485"><span class="hs-identifier hs-var">evs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hcat"><span class="hs-identifier hs-var">hcat</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; [SDoc]) -&gt; [SDoc] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Id -&gt; SDoc) -&gt; [Id] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; SDoc) -&gt; (Id -&gt; Type) -&gt; Id -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Type
</span><a href="GHC.Tc.Utils.TcType.html#evVarPred"><span class="hs-identifier hs-var">evVarPred</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([Id] -&gt; [SDoc]) -&gt; [Id] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Id -&gt; [Id]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Id
</span><a href="#local-6989586621680917485"><span class="hs-identifier hs-var">evs</span></a></span><span>
</span><span id="line-561"></span><span>
</span><span id="line-562"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#initTyState"><span class="hs-identifier hs-type">initTyState</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TyState"><span class="hs-identifier hs-type">TyState</span></a></span><span>
</span><span id="line-563"></span><span id="initTyState"><span class="annot"><span class="annottext">initTyState :: TyState
</span><a href="GHC.HsToCore.PmCheck.Types.html#initTyState"><span class="hs-identifier hs-var hs-var">initTyState</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag Id -&gt; TyState
</span><a href="GHC.HsToCore.PmCheck.Types.html#TySt"><span class="hs-identifier hs-var">TySt</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Id
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span>
</span><span id="line-564"></span><span>
</span><span id="line-565"></span><span class="hs-comment">-- | An inert set of canonical (i.e. mutually compatible) term and type</span><span>
</span><span id="line-566"></span><span class="hs-comment">-- constraints.</span><span>
</span><span id="line-567"></span><span class="hs-keyword">data</span><span> </span><span id="Delta"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier hs-var">Delta</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="MkDelta"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#MkDelta"><span class="hs-identifier hs-var">MkDelta</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="delta_ty_st"><span class="annot"><span class="annottext">Delta -&gt; TyState
</span><a href="GHC.HsToCore.PmCheck.Types.html#delta_ty_st"><span class="hs-identifier hs-var hs-var">delta_ty_st</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TyState"><span class="hs-identifier hs-type">TyState</span></a></span><span>    </span><span class="hs-comment">-- Type oracle; things like a~Int</span><span>
</span><span id="line-568"></span><span>                     </span><span class="hs-special">,</span><span> </span><span id="delta_tm_st"><span class="annot"><span class="annottext">Delta -&gt; TmState
</span><a href="GHC.HsToCore.PmCheck.Types.html#delta_tm_st"><span class="hs-identifier hs-var hs-var">delta_tm_st</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#TmState"><span class="hs-identifier hs-type">TmState</span></a></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-comment">-- Term oracle; things like x~Nothing</span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span class="hs-comment">-- | An initial delta that is always satisfiable</span><span>
</span><span id="line-571"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#initDelta"><span class="hs-identifier hs-type">initDelta</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier hs-type">Delta</span></a></span><span>
</span><span id="line-572"></span><span id="initDelta"><span class="annot"><span class="annottext">initDelta :: Delta
</span><a href="GHC.HsToCore.PmCheck.Types.html#initDelta"><span class="hs-identifier hs-var hs-var">initDelta</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyState -&gt; TmState -&gt; Delta
</span><a href="GHC.HsToCore.PmCheck.Types.html#MkDelta"><span class="hs-identifier hs-var">MkDelta</span></a></span><span> </span><span class="annot"><span class="annottext">TyState
</span><a href="GHC.HsToCore.PmCheck.Types.html#initTyState"><span class="hs-identifier hs-var">initTyState</span></a></span><span> </span><span class="annot"><span class="annottext">TmState
</span><a href="GHC.HsToCore.PmCheck.Types.html#initTmState"><span class="hs-identifier hs-var">initTmState</span></a></span><span>
</span><span id="line-573"></span><span>
</span><span id="line-574"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917475"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier hs-type">Delta</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-575"></span><span>  </span><span id="local-6989586621680917472"><span class="annot"><span class="annottext">ppr :: Delta -&gt; SDoc
</span><a href="#local-6989586621680917472"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span id="local-6989586621680917471"><span class="annot"><span class="annottext">Delta
</span><a href="#local-6989586621680917471"><span class="hs-identifier hs-var">delta</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Delta&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-576"></span><span>      </span><span class="hs-comment">-- intentionally formatted this way enable the dev to comment in only</span><span>
</span><span id="line-577"></span><span>      </span><span class="hs-comment">-- the info she needs</span><span>
</span><span id="line-578"></span><span>      </span><span class="annot"><span class="annottext">TmState -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Delta -&gt; TmState
</span><a href="GHC.HsToCore.PmCheck.Types.html#delta_tm_st"><span class="hs-identifier hs-var hs-var">delta_tm_st</span></a></span><span> </span><span class="annot"><span class="annottext">Delta
</span><a href="#local-6989586621680917471"><span class="hs-identifier hs-var">delta</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-579"></span><span>      </span><span class="annot"><span class="annottext">TyState -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Delta -&gt; TyState
</span><a href="GHC.HsToCore.PmCheck.Types.html#delta_ty_st"><span class="hs-identifier hs-var hs-var">delta_ty_st</span></a></span><span> </span><span class="annot"><span class="annottext">Delta
</span><a href="#local-6989586621680917471"><span class="hs-identifier hs-var">delta</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-580"></span><span>    </span><span class="hs-special">]</span><span>
</span><span id="line-581"></span><span>
</span><span id="line-582"></span><span class="hs-comment">-- | A disjunctive bag of 'Delta's, representing a refinement type.</span><span>
</span><span id="line-583"></span><span class="hs-keyword">newtype</span><span> </span><span id="Deltas"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-var">Deltas</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="MkDeltas"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-var">MkDeltas</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier hs-type">Delta</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span>
</span><span id="line-585"></span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#initDeltas"><span class="hs-identifier hs-type">initDeltas</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span><span>
</span><span id="line-586"></span><span id="initDeltas"><span class="annot"><span class="annottext">initDeltas :: Deltas
</span><a href="GHC.HsToCore.PmCheck.Types.html#initDeltas"><span class="hs-identifier hs-var hs-var">initDeltas</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag Delta -&gt; Deltas
</span><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-var">MkDeltas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Delta -&gt; Bag Delta
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="annot"><span class="annottext">Delta
</span><a href="GHC.HsToCore.PmCheck.Types.html#initDelta"><span class="hs-identifier hs-var">initDelta</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-587"></span><span>
</span><span id="line-588"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917464"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-589"></span><span>  </span><span id="local-6989586621680917460"><span class="annot"><span class="annottext">ppr :: Deltas -&gt; SDoc
</span><a href="#local-6989586621680917460"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-type">MkDeltas</span></a></span><span> </span><span id="local-6989586621680917459"><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917459"><span class="hs-identifier hs-var">deltas</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag Delta -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917459"><span class="hs-identifier hs-var">deltas</span></a></span><span>
</span><span id="line-590"></span><span>
</span><span id="line-591"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680917454"><span id="local-6989586621680917456"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semigroup</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-592"></span><span>  </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-type">MkDeltas</span></a></span><span> </span><span id="local-6989586621680917452"><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917452"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621680917451"><span class="annot"><span class="annottext">&lt;&gt; :: Deltas -&gt; Deltas -&gt; Deltas
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-type">MkDeltas</span></a></span><span> </span><span id="local-6989586621680917450"><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917450"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag Delta -&gt; Deltas
</span><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-var">MkDeltas</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917452"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Delta -&gt; Bag Delta -&gt; Bag Delta
forall a. Bag a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unionBags"><span class="hs-operator hs-var">`unionBags`</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917450"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-593"></span><span>
</span><span id="line-594"></span><span id="local-6989586621680918044"><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#liftDeltasM"><span class="hs-identifier hs-type">liftDeltasM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680918044"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier hs-type">Delta</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680918044"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Delta"><span class="hs-identifier hs-type">Delta</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680918044"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#Deltas"><span class="hs-identifier hs-type">Deltas</span></a></span></span><span>
</span><span id="line-595"></span><span id="liftDeltasM"><span class="annot"><span class="annottext">liftDeltasM :: forall (m :: * -&gt; *).
Monad m =&gt;
(Delta -&gt; m (Maybe Delta)) -&gt; Deltas -&gt; m Deltas
</span><a href="GHC.HsToCore.PmCheck.Types.html#liftDeltasM"><span class="hs-identifier hs-var hs-var">liftDeltasM</span></a></span></span><span> </span><span id="local-6989586621680917440"><span class="annot"><span class="annottext">Delta -&gt; m (Maybe Delta)
</span><a href="#local-6989586621680917440"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-type">MkDeltas</span></a></span><span> </span><span id="local-6989586621680917439"><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917439"><span class="hs-identifier hs-var">ds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag Delta -&gt; Deltas
</span><a href="GHC.HsToCore.PmCheck.Types.html#MkDeltas"><span class="hs-identifier hs-var">MkDeltas</span></a></span><span> </span><span class="annot"><span class="annottext">(Bag Delta -&gt; Deltas)
-&gt; (Bag (Maybe Delta) -&gt; Bag Delta) -&gt; Bag (Maybe Delta) -&gt; Deltas
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Bag (Maybe Delta) -&gt; Bag Delta
forall a. Bag (Maybe a) -&gt; Bag a
</span><a href="GHC.Data.Bag.html#catBagMaybes"><span class="hs-identifier hs-var">catBagMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">(Bag (Maybe Delta) -&gt; Deltas) -&gt; m (Bag (Maybe Delta)) -&gt; m Deltas
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Delta -&gt; m (Maybe Delta)) -&gt; Bag Delta -&gt; m (Bag (Maybe Delta))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">Delta -&gt; m (Maybe Delta)
</span><a href="#local-6989586621680917440"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Bag Delta
</span><a href="#local-6989586621680917439"><span class="hs-identifier hs-var">ds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-596"></span></pre></body></html>